#lang rosetta-racket


(require "random-graph-coords.rkt")

(provide line-house
         silk-house-example
         string-house-example)


(define line-house-vertices
  (vector
   (xyz 1 1 1)
   (xyz -1 1 1)
   (xyz -1 -1 1)
   (xyz 1 -1 1)
   (xyz 1 1 -1)
   (xyz -1 1 -1)
   (xyz -1 -1 -1)
   (xyz 1 -1 -1)
   (xyz 0.75 0 2.5)
   (xyz -0.75 0 2.5)))

(define line-house-neighbours
  (vector
   '(1 3 4 8)
   '(0 2 5 9)
   '(1 3 6 9)
   '(0 2 7 8)
   '(0 5 7)
   '(1 4 6)
   '(2 5 7)
   '(3 4 6)
   '(0 3 9)
   '(1 2 8)))

(define (line-house line-fn n)
  (line-fn
   (random-graph-coords line-house-vertices line-house-neighbours n)))

(define (silk-house-example)
  (view
   (xyz 4.821717981646502 -4.81231436873854 3.63568604819924)
   (xyz -1.1132145594965337 1.0762512751674969 -0.5965600698706837)
   (perspective 50)
   (line-house spline 1000)))

(define (string-house-example)
  (view
   (xyz 4.821717981646502 -4.81231436873854 3.63568604819924)
   (xyz -1.1132145594965337 1.0762512751674969 -0.5965600698706837)
   (perspective 50)
   (line-house line 1000)))